<?php
/*
DAD Online. Web browser MMORPG.
Copyright(C) 2012 Aceapps Aplicaciones. 
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses
*/

	// Session Start

	session_start();

	// Load files

	require_once '../include/config.php';
	require_once '../include/functions.php';

	// Login Validation

	if (!session_validate()) {
		header('Location: ../');
		exit;
	}

	// Get session variables

	$userid = $_SESSION['id'];

	// Character amount verification info
		
	$query = "SELECT * FROM characters WHERE user = $userid";
	$result = mysql_query($query) or die(mysql_error());
	$numrows = mysql_num_rows($result);

	// Load HTML5 Template

	$title = '<li><a href="index.php">Home</a></li>
		<li><a href="profile.php">Profile</a></li>';

	// Verify Room for More Characters

	if($numrows < $maxchars) {
		$title .= '<li><a href="cc.php">Create Character</a></li>';
	}

	$title .= '<li><a href="logout.php">Logout</a></li>';
	$depth = "../aat/"; include_once '../aat/header.php';

	// Profile

	echo 'Coming soon...';

	// Load HTML5 Template

	include_once '../aat/footer.php';
?>
